package dbutil;
import com.fjut.kms.tools.DBTools;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class DBconfigServlet
 */
public class DBconfigServlet extends HttpServlet {
	 private static final long serialVersionUID = 1L;

	 public static String DBurl=null;
	 public static String DBuser=null;
	 public static String DBpassword=null;

	 /**
	 	* 定义ServletConfig对象来接收配置的初始化参数
	  */
	 	private ServletConfig config;
	 	@Override
		public void init(ServletConfig config) throws ServletException {
			this.config = config;
			DBTools.CONN_URL= this.config.getInitParameter("CONN_URL");//获取指定的初始化参数
			DBTools.USERNAME= this.config.getInitParameter("USERNAME");//获取指定的初始化参数
			DBTools.PASS= this.config.getInitParameter("PASSWORD");//获取指定的初始化参数
	 	}
    /**
     * @see HttpServlet#HttpServlet()
     */
    public DBconfigServlet() {
        super();
        // TODO Auto-generated constructor stub
       
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
